<?php

/**
 * Created by PhpStorm.
 * User: colin
 * Date: 15-4-3
 * Time: 14:23
 */

namespace common\error;

class ErrorMsg {

    /**
     * 定义错误描述信息
     * @var array
     */
    public static $errMsg = [
        ErrorCode::ERR_QMYX_AGENCY_GET_EMPTY => '未能取到有效的中介机构信息',
        ErrorCode::ERR_QMYX_AGENCY_AUDIT_PASS_FAIL => '中介结构审核通过失败',
        ErrorCode::ERR_QMYX_AGENCY_AUDIT_PASS_EXCEPTION => '中介结构审核通过系统抛出异常',
        ErrorCode::ERR_QMYX_AGENCY_GET_BROKER_LIST_PARAMS_ERR => '获取机构待审核经纪人列表时传入的参数有误',
        ErrorCode::ERR_QMYX_AGENCY_GET_BROKER_LIST_STATUS_ERR => '只有已通过审核且未被禁用的中介机构才可查看其经纪人列表',
        ErrorCode::ERR_QMYX_AGENCY_GET_LIST_PARAMS_ERR => '传递的参数有误',
        ErrorCode::ERR_QMYX_CITY_REGION_CITY_MODE_UNDEFINED => '城市分组模式未定义',
        ErrorCode::ERR_QMYX_CITY_REGION_CITY_MODE_NOT_SUPPORT => '不支持的城市分组列表类型',
        ErrorCode::ERR_QMYX_CITY_REGION_CITY_NAME_ALREADY_EXISTS => '名称已经存在',
        ErrorCode::ERR_QMYX_CITY_REGION_HAS_FINAL_NODE => '存在末级节点',
        ErrorCode::ERR_QMYX_CITY_REGION_ACTIVE_RECORD_EXCEPTION => '数据库异常',
        ErrorCode::ERR_QMYX_CITY_REGION_CITY_NAME_IS_EMPTY => '名称不允许为空',
        ErrorCode::ERR_QMYX_CITY_REGION_MISSING_PRIMARY_KEY => '主键缺失',
        ErrorCode::ERR_QMYX_CITY_REGION_INVALID_ORDINAL => '无效的顺序值',
        ErrorCode::ERR_QMYX_CITY_REGION_INVALID_CITY_MODE => '无效的城市分组模式',
        ErrorCode::ERR_QMYX_CITY_REGION_PARAMETER_IS_EMPTY => '参数不能为空',
        ErrorCode::ERR_QMYX_CITY_REGION_RECORD_NOT_EXISTS => '记录不存在',
        ErrorCode::ERR_QMYX_CITY_REGION_CANNOT_READ_TOKEN => '无法访问到Token属性，请刷新页面重试',
        ErrorCode::ERR_QMYX_KNOWLEDGE_INVALID_KNOWLEDGE_TYPE_ID => '无效的知识库类别ID',
        ErrorCode::ERR_QMYX_KNOWLEDGE_INVALID_KNOWLEDGE_ID => '无效的知识库ID',
        ErrorCode::ERR_QMYX_KNOWLEDGE_TYPE_NAME_ALREADY_EXISTS => '知识库类别名称已经存在',
        ErrorCode::ERR_QMYX_KNOWLEDGE_TITLE_ALREADY_EXISTS => '知识库标题已经存在',
        ErrorCode::ERR_QMYX_KNOWLEDGE_TYPE_RECORD_NOT_EXISTS => '知识库类别记录不存在',
        ErrorCode::ERR_QMYX_KNOWLEDGE_ACTIVE_RECORD_EXCEPTION => '数据库异常',
        ErrorCode::ERR_QMYX_KNOWLEDGE_ENTITY_IS_EMPTY => '知识对象传递了空集合',
        ErrorCode::ERR_QMYX_KNOWLEDGE_TYPE_ENTITY_IS_EMPTY => '知识类别对象传递了空集合',
        ErrorCode::ERR_QMYX_KNOWLEDGE_MISSING_PRIMARY_KEY => '更新对象时，未传递主键属性',
        ErrorCode::ERR_QMYX_KNOWLEDGE_MISSING_TOKEN => '未传递Token关键字',
        ErrorCode::ERR_QMYX_KNOWLEDGE_INVALID_PAGING_PARAMETER => '无效的分页参数',
        ErrorCode::ERR_QMYX_KNOWLEDGE_TYPE_PARAMETER_IS_EMPTY => '参数不能为空',
        ErrorCode::ERR_QMYX_KNOWLEDGE_PARAMETER_IS_EMPTY => '参数不能为空',
        ErrorCode::ERR_QMYX_PAYMENT_MISSING_TOKEN => 'Token不能为空',
        ErrorCode::ERR_QMYX_PAYMENT_ARGUMENT_IS_EMPTY => '参数不能为空',
        ErrorCode::ERR_QMYX_PAYMENT_INVALID_ARGUMENT => '无效的参数',
        ErrorCode::ERR_QMYX_PAYMENT_AUTHORIZE_PAY_INVALID_STATUS => '无效的代付款项记录状态',
        ErrorCode::ERR_QMYX_PAYMENT_AUTHORIZE_RECORD_NOT_EXISTS => '代付款项记录不存在',
        ErrorCode::ERR_QMYX_PAYMENT_ACTIVE_RECORD_EXCEPTION => '数据库异常',
        ErrorCode::ERR_QMYX_PAYMENT_INVOKE_SAVE_PAYMENT_ERROR => '委托发放代付款项失败',
        ErrorCode::ERR_WLS_BAOMING_SUBMIT_UNSHOW => '报名失败,活动不存在',
        ErrorCode::ERR_WLS_BAOMING_SUBMIT_NONPARTY => '报名失败,活动已结束',
        ErrorCode::ERR_WLS_BAOMING_SUBMIT_OVERDUE => '报名失败,活动已结束',
        ErrorCode::ERR_WLS_BAOMING_SUBMIT_REPEAT => '报名失败,您已经报过名了',
        //经纪人模块
        ErrorCode::ERR_QMYX_BROKER_UNSAFEID => '经纪人ID不正确',
        ErrorCode::ERR_QMYX_BROKER_ALLREADY_ENABLED => '已经是启用的经纪人',
        ErrorCode::ERR_QMYX_BROKER_ALLREADY_DISABLED => '已经是禁用的经纪人',
        ErrorCode::ERR_QMYX_BROKER_ALLREADY_PASSED => '已经是审核通过的经纪人',
        ErrorCode::ERR_QMYX_BROKER_ALLREADY_NOTPASSED => '已经是审核不通过的经纪人',
        ErrorCode::ERR_QMYX_BROKER_UNCRROCT_PASSWORD => '经纪人密码不正确',
        ErrorCode::ERR_QMYX_BROKER_GENERATERE_COMMEND_BROKERAGE => "生成邀请经纪人佣金出错",
        ErrorCode::ERR_QMYX_BROKER_DELETE_COMMEND_BROKERAGE => "删除邀请经纪人佣金出错",
        ErrorCode::ERR_QMYX_BROKER_IMPORTFILE_UNSAFE => "导入经纪人身份的文件格式不正确",
        ErrorCode::ERR_QMYX_BROKER_APPEAL_UNSAFEID => '经纪人的申诉ID不正确',
        ErrorCode::ERR_QMYX_BROKER_APPEAL_ACCEPTERROR_YDACAPI => 'ydacapi处理申诉处理失败',
        ErrorCode::ERR_QMYX_BROKER_APPEAL_ALLREADYDEALED => '该申诉已经处理过了',
        //模板设置相关
        ErrorCode::ERR_STYLE_SETTING_TOKEN_IS_EMPTY => 'token不能为空',
        ErrorCode::ERR_STYLE_SETTING_STYLE_CODE_IS_EMPTY => 'style_code不能为空',
        ErrorCode::ERR_STYLE_SETTING_NAV_SETTING_ID_IS_EMPTY => 'nav_setting_id参数不能为空',
        ErrorCode::ERR_STYLE_SETTING_ACTIVE_RECORD_EXCEPTION => '数据库异常',
        ErrorCode::ERR_STYLE_SETTING_NAV_NAME_IS_EMPTY => 'nav_name参数为空',
        ErrorCode::ERR_STYLE_SETTING_NAV_IMG_IS_EMPTY => 'nav_img参数为空',
        ErrorCode::ERR_STYLE_SETTING_OID_IS_NOT_VALID => 'oid参数无效',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_BUGUID_UNSAFEID => '无效的BUGUID',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_BUGUID_NOTALLOWDELETE => '当前组织机构已有关联的对象，不允许被删除',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_BUGUID_UNCORRECTDATA => '提交的公司（部门/团队）数据校验不通过',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_BUGUID_UNUNIQUENAME => '组织编码不能重复',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_USER_UNSAFEID => '无效的UserGUID',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_USER_UNCORRECTDATA => '提交的用户数据校验不通过',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_USER_UNUNIQUECODE => '用户代码不能重复',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_USER_PASSWORDNOTEQUAL => '两次密码不一致',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_USER_PASSWORDNOTVALIDATE => '密码应在1-20个字符',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_ROLE_UNSAFEID => '无效的ROLEID',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_ROLE_NOTALLOWDELETE => '当前角色已有关联的用户，不允许被删除',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_ROLE_UNCORRECTDATA => '提交的角色数据校验不通过',
        ErrorCode::ERR_KFSADMIN_USERMANAGE_ROLE_UNUNIQUENAME => '角色名称不能重复',
        //系统统一错误 没有权限
        ErrorCode::ERR_KFSADMIN_NO_ACCESS_MODULE => "没有模块权限",
        ErrorCode::ERR_KFSADMIN_NO_ACCESS_TOKEN => "没有公众号权限",
        ErrorCode::ERR_KFSADMIN_NO_ACCESS_PROJECT => "没有项目权限",
        //系统统一错误
        ErrorCode::ERR_PARAMS_ERR => '参数错误',
        ErrorCode::ERR_REQUEST_MUST_GET => '必须使用get请求',
        ErrorCode::ERR_REQUEST_MUST_POST => '必须使用post请求',
        ErrorCode::ERR_ENTITY_ERR => 'entity层数据操作错误',
        ErrorCode::ERR_DATA_VERIFY_FALSE => '数据保存验证失败',
        //明源后台错误
        ErrorCode::ERR_CONTRACT_PARAM_INVALID => '合同参数校验失败',
        ErrorCode::ERR_CONTRACT_ADD => '增加合同失败',
        ErrorCode::ERR_CONTRACT_UPDATE => '更新合同失败',
        ErrorCode::ERR_CONTRACT_NOT_EXISTS => '合同不存在',
        ErrorCode::ERR_CONTRACT_APPROVE_STATUS => '合同已审批不能修改',
        ErrorCode::ERR_CONTRACT_EXIST_INVOICE => '合同存在发票不能作废',
        ErrorCode::ERR_CONTRACT_EXIST_PAYMENT => '合同存在关联回款不能作废',
        ErrorCode::ERR_INVOICE_FORM_VERIFY_FAIL => '发票保存时校验数据失败',
        ErrorCode::ERR_INVOICE_FORM_SAVE_FAIL => '发票保存失败',
        ErrorCode::ERR_INVOICE_DELETE_FAIL => '删除发票失败',
        ErrorCode::ERR_INVOICE_SUMMARY_FORM_SAVE_FAIL => '发票摘要保存失败',
        ErrorCode::ERR_INVOICE_SUMMARY_DELETE_FAIL => '删除发票摘要失败',
        ErrorCode::ERR_INVOICE_DOLOSE_FAIL => '设置发票遗失失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_FORM_VERIFY_FAIL => '合同应收款项保存时校验数据失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_FORM_SAVE_FAIL => '合同应收款项保存失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_SPLIT_FORM_VERIFY_FAIL => '合同应收款项拆分明细保存时校验数据失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_SPLIT_FORM_SAVE_FAIL => '合同应收款项拆分明细保存失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_NOT_EXISTS => '合同应收款项不存在',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_CHANGE_RESPONSIBLE_FORM_VERIFY_FAIL => '合同应收款项责任人变更校验数据失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_CHANGE_RESPONSIBLE_FORM_SAVE_FAIL => '合同应收款项责任人变更保存失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_CHANGE_RECEIVABLE_DATE_FORM_VERIFY_FAIL => '合同应收款项应收款时间变更校验数据失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_CHANGE_RECEIVABLE_DATE_FORM_SAVE_FAIL => '合同应收款项应收款时间变更保存失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_MARK_BAD_DEBT_FORM_SAVE_FAIL => '合同应收款项标记为坏账保存失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_MARK_OPERATION_FORM_SAVE_FAIL => '合同应收款项标记为运营关注保存失败',
        ErrorCode::ERR_INVOICE_NOT_EXISTS => '发票不存在',
        ErrorCode::ERR_INVOICE_RECEIVABLE_FORM_SAVE_FAIL => '合同应收款项与发票关系保存失败',
        ErrorCode::ERR_EXIST_CONTRACT_CODE => '合同编号已被使用',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_DELETE_FAIL => '删除合同应收款信息失败',
        ErrorCode::ERR_CONTRACT_PAYMENT_FORM_VERIFY_FAIL => '合同回款保存校验失败',
        ErrorCode::ERR_CONTRACT_PAYMENT_FORM_SAVE_FAIL => '合同回款保存失败',
        ErrorCode::ERR_VIOLATED_CONTRACT_FORM_VERIFY_FAIL => '违规合同保存校验数据失败',
        ErrorCode::ERR_VIOLATED_CONTRACT_SAVE_FAIL => '违规合同保存失败',
        ErrorCode::ERR_VIOLATED_CONTRACT_FIND_FAIL => '违规合同查询失败',
        ErrorCode::ERR_SPECIAL_APPROVAL_INVOICE_FORM_VERIFY_FAIL => '特批发票保存校验数据失败',
        ErrorCode::ERR_SPECIAL_APPROVAL_INVOICE_SAVE_FAIL => '特批发票保存失败',
        ErrorCode::ERR_SPECIAL_APPROVAL_INVOICE_FIND_FAIL => '特批发票查询失败',
        ErrorCode::ERR_SPECIAL_APPROVAL_AUTHORIZE_FORM_VERIFY_FAIL => '特批授权保存校验数据失败',
        ErrorCode::ERR_SPECIAL_APPROVAL_AUTHORIZE_SAVE_FAIL => '特批授权保存失败',
        ErrorCode::ERR_SPECIAL_APPROVAL_AUTHORIZE_FIND_FAIL => '特批授权查询失败',
        ErrorCode::ERR_KFSADMIN_PROFILE_NEW_PASSWORD_UNCORRECT => '密码应在1-20个字符',
        ErrorCode::ERR_KFSADMIN_PROFILE_PASSWORD_ERROR => '旧密码输入错误',
        ErrorCode::ERR_KFSADMIN_PROFILE_NEW_PASSWORD_NOTEQUAL => '两次密码不一致',
        ErrorCode::ERR_KFSADMIN_PROFILE_NOT_ADMIN => '只有超级用户才能执行该操作',
        ErrorCode::ERR_CONTRACT_PAYMENT_NOT_EXISTS => '合同回款不存在',
        ErrorCode::ERR_CONTRACT_PAYMENT_DELETE_FAIL => '删除合同回款失败',
        ErrorCode::ERR_SPECIAL_APPROVAL_INVOICE_DELETE_FAIL => '删除特批发票失败',
        ErrorCode::ERR_CONTRACT_AUDIT_STATUS => '合同已审批或草稿不能复核',
        ErrorCode::ERR_INVOICE_CODE_EXIST_SAME => '发票代码重复',
        ErrorCode::ERR_INVOICE_NO_EXIST_SAME => '发票号码重复',
        ErrorCode::ERR_CONTRACT_REVENUE_SUM => '合同收入明细汇总不等于合同收入金额',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_SUM => '合同应收金额汇总不等于合同收入金额',
        ErrorCode::ERR_CONTRACT_SIGN_ACHIEVEMENT_SUM => '合同签约业绩金额汇总不等于合同收入金额',
        ErrorCode::ERR_CONTRACT_SUBMIT_REVIEW_STATUS => '合同草稿状态,不能提交复核',
        ErrorCode::ERR_CONTRACT_CANCEL_REVIEW_STATUS => '合同状态不是提交复核,不能撤销复核',
        ErrorCode::ERR_CONTRACT_AUDIT_REVIEW_STATUS => '合同状态不是提交复核,不能复核',
        ErrorCode::ERR_CONTRACT_CANCELLED_APPROVE_STATUS => '合同已审批，不允许作废',
        ErrorCode::ERR_CONTRACT_NOT_APPLICATION => '合同不存在产品，不允许提交复核',
        ErrorCode::ERR_CONTRACT_NOT_COMPANY => '帐套公司不能为空',
        ErrorCode::ERR_CONTRACT_NOT_REVENUE => '合同收入信息不能为空',
        ErrorCode::ERR_RECEIPT_NO_EXIST_SAME => '收据号码重复',
        ErrorCode::ERR_CONTRACT_HAS_NO_PRODUCT => '合同小类为“软件专项服务”时，新增产品为非必填项',


        //认筹理财
        ErrorCode::ERR_TEAMBUY_VERIFY_FAIL => '认筹校验不正确',
        ErrorCode::ERR_TEAMBUY_ADD_FAIL => '认筹新增失败',
        ErrorCode::ERR_TEAMBUY_UPDATE_FAIL => '认筹更新失败',
        ErrorCode::ERR_TEAMBUY_NOT_EXIST => '认筹不存在',
        ErrorCode::ERR_TEAMBUY_PUBLISH => '认筹上架失败',
        ErrorCode::ERR_TEAMBUY_NOT_PUBLISH => '认筹下架失败',
        ErrorCode::ERR_BANNER_VERIFY_FAIL => '横幅图数据校验不正确',
        ErrorCode::ERR_BANNER_ADD_FAIL => '横幅图新增失败',
        ErrorCode::ERR_BANNER_UPDATE_FAIL => '横幅图更新失败',
        ErrorCode::ERR_BANNER_NOT_EXIST => '横幅图不存在',
        ErrorCode::ERR_BANNER_DELETE => '横幅图删除失败',
        ErrorCode::ERR_GET_TOKEN_FAIL => '获取token失败',
        ErrorCode::ERR_GET_WX_USERINFO_FAIL => '获取微信用户信息失败',
        ErrorCode::ERR_SYNC_WX_USERINFO_FAIL => '同步微信用户信息失败',
        ErrorCode::ERR_GET_OPENID_FAIL => '获取openid失败',
        ErrorCode::ERR_AUTO_LOGIN_FAIL => '自动登录失败',
        ErrorCode::ERR_ADD_FAVORITE_FAIL => '增加收藏活动失败',
        ErrorCode::ERR_CANCEL_FAVORITE_FAIL => '取消收藏活动失败',
        ErrorCode::ERR_CUSTOMER_NOT_EXIST => '客户不存在',
        ErrorCode::ERR_UPDATE_USERINFO_FAIL => '更新客户信息失败',
        ErrorCode::ERR_TEAMBUY_ORDER_NO_EXIST => '认筹单不存在',
        ErrorCode::ERR_TEAMBUY_ORDER_SAVE_FAIL => '保存认筹单失败',
        ErrorCode::ERR_TEAMBUY_ORDER_VERIFY_FAIL => '校验认筹单数据失败',
        ErrorCode::ERROR_TEAMBUY_ORDER_STATUS => '认筹订单状态错误',
        ErrorCode::ERROR_ORDER_CODE_GENERATE => '认筹生成订单号失败',
        ErrorCode::ERROR_TEAMBUY_ORDER_CODE_ILLEGAL => '传入认筹订单号非法',
        ErrorCode::ERROR_TEAMBUY_GET_FREEZING_PAGE => '获取认筹冻结页面出错',
        ErrorCode::ERROR_TEAMBUY_CANNOT_ORDER => '认筹活动不允许下单',
        ErrorCode::ERROR_TEAMBUY_ORDER_EXPIRED => '认筹单已过期',
        ErrorCode::ERR_TEAMBUY_END_DATE_FAIL => '认筹结束时间不能小于当前时间',
        ErrorCode::ERR_TEAMBUY_JIECHOU_FAIL => '认筹解筹失败',
        ErrorCode::ERR_TEAMBUY_UPDATE_END_DATE_FAIL => '此活动结束时间已过期，请先修改结束时间',
        ErrorCode::ERR_TEAMBUY_EXIST_PUBLISH_STATUS => '此楼盘已存在上架的认筹活动',
        ErrorCode::SMS_SEND_FAIL => '短信发送失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_HAS_FAPIAO_SPLIT_FORM_VERIFY_FAIL => '当前应收款已关联了发票，不允许拆分',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_SENT_BUSSENISS_FAIL => '通知商机系统失败',
        ErrorCode::ERR_CONTRACT_RECEIVABLE_SPLIT_FAIL => '款项拆分失败',
	//渠道来源
	ErrorCode::ERR_CHANNEL_SOURCE_VERIFY_FAIL => '渠道来源保存时数据校验失败',
        ErrorCode::ERR_CHANNEL_SOURCE_SAVE_FAIL => '渠道来源保存失败',
        ErrorCode::ERR_CHANNEL_SOURCE_NOT_EXISTS => '渠道来源不存在',
        ErrorCode::ERR_CHANNEL_SOURCE_DELETE_FAIL => '删除渠道来源失败',
        ErrorCode::ERR_CHANNEL_SOURCE_FANS_DELETE_FAIL => '删除渠道来源与粉丝失败'
    ];

    /**
     * 获取错误描述信息
     * @param $errCode
     * @return string
     */
    public static function getErrMsg($errCode) {
        return isset(self::$errMsg[$errCode]) ? self::$errMsg[$errCode] : self::getDefaultMsg();
    }

    /**
     * 获取默认的错误描述信息
     * @return string
     */
    public static function getDefaultMsg() {
        return '服务器错误';
    }

}
